/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package strategies;

/**
 *
 * @author Alejandro
 */
public class StrategyFactory {

    public static Strategy createStrategy(String typeName) {
        Strategy s = null;
        try {
            Class c = Class.forName(typeName);
            if (c.getGenericInterfaces()[0].equals(Strategy.class)) {
                s = (Strategy) c.newInstance();
            }
        } catch(Exception e) {
        }
        return s;
    }
}
